import request from '@/utils/http'
import { LoginParams, PhoneLoginParams, GetCodeParams, LoginResult } from './model/loginModel'

export class LoginService {
  // 账号密码登录
  static login(params: LoginParams): Promise<LoginResult> {
    return request.post({
      url: '/admin/login',
      data: params
    })
  }


  //修改 手机号验证码登录


  static phoneLogin(params: PhoneLoginParams): Promise<LoginResult> {
    console.log('test')
    return request.post({
      url: '/admin/login',
      data: params
    })
  }

  // 获取短信验证码
  static getCode(params: GetCodeParams): Promise<LoginResult> {
    return request.post({
      url: '/admin/getCode',
      data: params
    })
  }
}